﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Paper.aspx.cs" Inherits="OnLineExam.Web.mag.Paper" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>试卷制定</title>
	<link href="../jquery-easyui-1.2.5/themes/default/easyui.css" rel="stylesheet" type="text/css" />
	<link href="../jquery-easyui-1.2.5/themes/icon.css" rel="stylesheet" type="text/css" />
	<script src="../jquery-easyui-1.2.5/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="../jquery-easyui-1.2.5/jquery.easyui.min.js" type="text/javascript"></script>
	<script src="../Scripts/jQuery.FillOptions.js" type="text/javascript"></script>
	<script src="../jquery-easyui-1.2.5/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function () {
			//var myDate = new Date();
			//$("#txtStartDateTime").val(myDate.toLocaleString()); //获取日期与时间
			//$("#txtEndDateTime").val(myDate.toLocaleString()); //获取日期与时间
			$("#selectDep").attr("value", '<%=Umodel.DepID %>');
			$("#selectDep").FillOptions('GetDepInfoHandler.ashx?c=' + new Date().getMilliseconds() + '&type=getlist&depid=<%=Umodel.DepID %>', { datatype: "json", textfield: "Name", valuefiled: "ID" });
			$("#selectCourse").FillOptions('GetCourseHandler.ashx?c=' + new Date().getMilliseconds() + '&type=getlist&depid=<%=Umodel.DepID %>', { datatype: "json", textfield: "CourseName", valuefiled: "CourseID" });
            <%if (User.IsInRole("教师"))
		{ %>
			$("#ff table tr").eq(0).hide();
                        //$("#selectDep").attr("disabled", 'disabled'); //默认选中disabled
                        <%} %>
			$("#selectDep").change(function () {
				$("#selectCourse").empty();
				$("#selectCourse").FillOptions('GetCourseHandler.ashx?c=' + new Date().getMilliseconds() + '&type=getlist&depid=' + $("#selectDep").val(), { datatype: "json", textfield: "CourseName", valuefiled: "CourseID" });
			});
		})
		function save() {

			$('#ff').form('submit', {
				url: 'Handler/PaperHandler.ashx?d=' + new Date().getMilliseconds() + '&type=addsave&depid=<%=Umodel.DepID %>',
				onSubmit: function () {
					return $(this).form('validate');
				},
				success: function (data) {
					$.messager.alert('操作结果', "执行成功，编号为：" + data, 'info');
					window.location.href = "paperlist.aspx";
					//$('#dd').dialog('close')
				}
			});
		}
	</script>
	<style type="text/css">
		td {
			border-right: 1px solid #C1DAD7;
			border-bottom: 1px solid #C1DAD7;
			padding: 6px 6px 6px 12px;
		}

			td.alt {
				background: #F5FAFA;
				color: #797268;
			}
	</style>
</head>
<body>
	<div style="background: #fafafa; padding: 5px;" buttons="#dd-buttons">
		<div id="p" class="easyui-panel" style="padding: 10px;"
			title="制定试卷配置信息" iconcls="icon-add"
			collapsible="true"
			maximizable="true" closable="true">
			<form id="ff" method="post">
				<table style="width: 100%;" align="left">
					<tr>
						<td align="right">部门：</td>
						<td align="left" colspan="3">
							<select id="selectDep" name="selectDep"
								name="state" style="width: 200px;" required="true">
								<option></option>
							</select></td>
					</tr>
					<tr>
						<td align="right">&nbsp;
                            试卷科目:</td>
						<td align="left" colspan="3">
							<select id="selectCourse" name="selectCourse" name="state" style="width: 200px;" required="true">
								<option></option>
							</select></td>
					</tr>
					<tr>
						<td align="right">&nbsp;
                            试卷名称：</td>
						<td align="left" colspan="3">
							<textarea id="txtPaperName" name="txtPaperName" class="easyui-validatebox" cols="50" rows="2" required="true"></textarea>&nbsp;
						</td>
					</tr>
					<tr>
						<td align="right">&nbsp;
                            开始日期：</td>
						<td align="left">
							<input class="easyui-datetimebox" id="txtStartDateTime" name="txtStartDateTime" required="true" value="3/4/2010 2:3:56" style="width: 150px"></td>
						<td align="right">结束日期：
						</td>
						<td>
							<input class="easyui-datetimebox" id="txtEndDateTime" name="txtEndDateTime" required="true" value="3/4/2010 2:3:56" style="width: 150px">&nbsp;</td>
					</tr>
					<tr>
						<td align="right">&nbsp; 考试时长：</td>
						<td align="left">
							<input id="txtExamTime" name="txtExamTime" class="easyui-numberspinner" max="150" min="10" required="true"
								style="width: 80px;" />分钟</td>
						<td align="right">可考试次数：</td>
						<td>
							<input id="txtallowExamNum" name="txtallowExamNum" class="easyui-numberspinner" max="10" min="1" required="true"
								style="width: 80px;" />
							数字范围：1-10</td>
					</tr>
					<tr>
						<td align="right">及格分数：</td>
						<td align="left">
							<input id="txtpassmark" name="txtpassmark" class="easyui-numberspinner" max="150" min="10" precision="0" required="true"
								style="width: 80px;" /></td>
						<td align="right">&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td align="right">选择参试人员：</td>
						<td align="left" colspan="3" style="border-bottom-color: #C1DAD7">&nbsp;</td>
					</tr>
					<tr>
						<td align="right">参试人员：</td>
						<td align="left" colspan="3">
							<textarea id="txtJoinEmpID" name="txtJoinEmpID" class="easyui-validatebox" cols="65" name="S2" rows="5" required="true"></textarea></td>
					</tr>
					<tr>
						<td align="right">&nbsp;</td>
						<td align="left" colspan="3">&nbsp;</td>
					</tr>

					<tr>
						<td align="right"><strong>单选题</strong>：</td>
						<td align="left" colspan="3">题目数量：<input
							id="txtSingleNum" name="txtSingleNum" class="easyui-numberspinner" max="50" min="0" precision="0"
							required="true" style="width: 80px;" />&nbsp;每题分数：<input
								id="txtSingleFen" name="txtSingleFen" class="easyui-numberspinner" max="50" min="0" precision="0"
								required="true" style="width: 80px;" />
							说明：数量0到50正整数；分数0到50 允许2位小数</td>
					</tr>

					<tr>
						<td align="right"><strong>多选题</strong>：</td>
						<td align="left" colspan="3">题目数量：<input
							id="txtMultiNum" name="txtMultiNum" class="easyui-numberspinner" max="50" min="0" precision="0"
							required="true" style="width: 80px;" />&nbsp;每题分数：<input
								id="txtMultiFen" name="txtMultiFen" class="easyui-numberspinner" max="50" min="0" precision="0"
								required="true" style="width: 80px;" />
							说明：数量0到50正整数；分数0到50 允许2位小数</td>
					</tr>
					<tr>
						<td align="right"><strong>判断题</strong>：</td>
						<td align="left" colspan="3">题目数量：<input
							id="txtJudgeNum" name="txtJudgeNum" class="easyui-numberspinner" max="50" min="0" precision="0"
							required="true" style="width: 80px;" />&nbsp;每题分数：<input
								id="txtJudgeFen" name="txtJudgeFen" class="easyui-numberspinner" max="50" min="0" precision="0"
								required="true" style="width: 80px;" />
							说明：数量0到50正整数；分数0到50 允许2位小数</td>
					</tr>

					<tr>
						<td align="right"><strong>填空题</strong>：</td>
						<td align="left" colspan="3">题目数量：<input
							id="txtFillBlankNum" name="txtFillBlankNum" class="easyui-numberspinner" max="50" min="0" precision="0"
							required="true" style="width: 80px;" />&nbsp;每题分数：<input
								id="txtFillBlankFen" name="txtFillBlankFen" class="easyui-numberspinner" max="50" min="0" precision="0"
								required="true" style="width: 80px;" />
							说明：数量0到50正整数；分数0到50 允许2位小数</td>
					</tr>

					<tr>
						<td align="right"><strong>问答题</strong>：</td>
						<td align="left" colspan="3">题目数量：<input
							id="txtQuestionNum" name="txtQuestionNum" class="easyui-numberspinner" max="50" min="0" precision="0"
							required="true" style="width: 80px;" />&nbsp;每题分数：<input
								id="txtQuestionFen" name="txtQuestionFen" class="easyui-numberspinner" max="50" min="0" precision="0"
								required="true" style="width: 80px;" />
							说明：数量0到50正整数；分数0到50 允许2位小数</td>
					</tr>

					<tr>
						<td align="right">&nbsp;</td>
						<td align="left" colspan="3">
							<a class="easyui-linkbutton" href="#" onclick="save()">提交</a>
							<a class="easyui-linkbutton" href="#" onclick="closess()">取消</a></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>
